﻿using System.Buffers;

namespace tcp_connection;

public class ClientTcpConnection : ATcpConnection
{
    public long count;

    public override void OnActive()
    {
        base.OnActive();

        //Console.WriteLine("客户端=======一个channel被打开");
    }

    protected override async void OnMessage(ReadOnlySequence<byte> buf)
    {
        count++;
        //Console.WriteLine("客户端：：" + System.Text.Encoding.UTF8.GetString(buf.ToArray()));
        this.InternalWrite(ref buf);
        await FlushAsync();
    }
}